package com.lczyfz.campusinfo.common.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by jw on 2016/11/21.
 */
public class MsgCodeHelper {
    /*******
     *
     * 提示的消息编码说明：以MG开头，后面6位是十六进制编码0-F  021101
     第一位：0表示消息属于client端的消息； 1表示属于管理员后台端消息
     第二位：管理员后台端消息模块（0乐狗管理后台）
     client端消息模块（0app 1web前端 2商户后端）
     第三位：管理员后台端消息模块（0公共 1项目模块 2订单模块，3用户模块）
     client端（app，web前端）消息模块（0公共 1项目模块 2订单模块，3用户模块,4购物车模块，5运费模块）
     第四位：管理员后台端消息模块（按照每个模块的子模块进行由1-F进行编号）
     client端消息模块（按照每个模块的子模块进行由1-F进行编号）
     子模块定义方式？增删改查+可拆分子模块
     第五，六位：管理员后台端消息模块（按照具体提示信息标号 从01-FF进行编号）
     client端消息模块（按照具体提示信息标号 从01-FF进行编号）
     **********/
//==========================client端===========================
    //==========================公共模块===========================
    public static final String MG010101 = "操作成功";//前端--公共模块-获取数据-01消息
    public static final String MG010102 = "操作失败";//前端-公共模块-获取数据-02消息
    public static final String MG010103 = "未登录";//前端-公共模块-获取数据-03消息
    public static final String MG010104 = "系统繁忙";//前端-公共模块-获取数据-03消息


    //==========================项目模块===========================
    //第四位（定义说明）
    //==========================/项目模块===========================
    public static final String MG0210101 = "商品发布成功";//client端-商户后端-项目模块-商品发布-01消息
    public static final String MG0210102 = "上传商品规格图片数量与主规格值数量不符";//client端-商户后端-项目模块-商品发布-02消息
    public static final String MG0210103 = "上传商品图片数过多";//client端-商户后端-项目模块-商品发布-03消息


    //==========================订单模块===========================
    //第四位（定义说明）
    public static final String MG013101 = "用户名重复";//前端-用户模块-获取数据-01消息
    public static final String MG013102 = "手机号重复";//前端-用户模块-获取数据-02消息
    public static final String MG013103 = "输入的密码与确认的密码不匹配";//前端-用户模块-获取数据-03消息
    public static final String MG013104 = "图片验证码错误";//前端-用户模块-获取数据-04消息
    public static final String MG013105 = "短信验证失败";//前端-用户模块-获取数据-05消息
    public static final String MG013106 = "未勾选《乐狗用户注册协议》";//前端-用户模块-获取数据-06消息
    public static final String MG013107 = "未找到该用户，请确认用户名或手机号或邮箱！";//前端-用户模块-获取数据-07消息
    public static final String MG013108 = "该验证的手机号不匹配！";//前端-用户模块-获取数据-08消息
    public static final String MG013109 = "未选中收货地址";//前端-用户模块-获取数据-09消息
    public static final String MG01310a = "该银行卡号不合法";//前端-用户模块-获取数据-0a消息
    public static final String MG01310b = "该用户拥有收货地址超过100个，无法再添加收货地址";//前端-用户模块-获取数据-0b消息
    public static final String MG01310c = "身份证号错误";//前端-用户模块-获取数据-0c消息
    public static final String MG01310d = "银行卡号错误";//前端-用户模块-获取数据-0d消息
    public static final String MG01310e = "该用户绑定银行卡超过20张";//前端-用户模块-获取数据-0e消息
    public static final String MG01310f = "未选中银行卡";//前端-用户模块-获取数据-0f消息
    public static final String MG01310g = "未绑定银行卡";//前端-用户模块-获取数据-0f消息
    public static final String MG013110 = "绑定的最后一张银行卡，无法删除";//前端-用户模块-获取数据-10消息
    public static final String MG013111 = "昵称重复";//前端-用户模块-获取数据-11消息
    public static final String MG013112 = "密码错误";//前端-用户模块-获取数据-12消息
    public static final String MG013113 = "该用户未实名认证";//前端-用户模块-获取数据-13消息
    public static final String MG013114 = "用户支付密码应为六位数字";//前端-用户模块-获取数据-14消息
    public static final String MG013115 = "支付密码已存在";//前端-用户模块-获取数据-15消息
    public static final String MG013116 = "该用户已实名认证";//前端-用户模块-获取数据-16消息
    public static final String MG013117 = "手机号格式错误";//前端-用户模块-获取数据-17消息
    public static final String MG013118 = "该用户未设置支付密码";//前端-用户模块-获取数据-18消息
    public static final String MG013119 = "最后一条地址，无法删除";//前端-用户模块-获取数据-19消息
    public static final String MG01311a = "请从上一步进入:token错误";//前端-用户模块-获取数据-1a消息
    public static final String MG01311b = "数据无效";//前端-用户模块-获取数据-1b消息
    public static final String MG01311c = "请设置支付密码";//前端-用户模块-获取数据-1c消息
    public static final String MG01311d = "该用户选择的银行错误";//前端-用户模块-获取数据-1c消息
    public static final String MG013201 = "邮箱验证失败";//前端-用户模块-邮箱验证-01消息
    public static final String MG013202 = "邮箱已被使用";//前端-用户模块-邮箱验证-02消息
    public static final String MG013203 = "邮箱格式错误";//前端-用户模块-邮箱验证-03消息
    public static final String MG013301 = "未选中商品";//前端-用户模块-关注中心-01消息
    public static final String MG013302 = "未选中需要取消关注的商品";//前端-用户模块-关注中心-02消息
    public static final String MG013303 = "重复关注该商品";//前端-用户模块-关注中心-03消息
    public static final String MG013304 = "未选中店铺";//前端-用户模块-关注中心-04消息
    public static final String MG013305 = "未选中需要取消关注的店铺";//前端-用户模块-关注中心-05消息
    public static final String MG013306 = "重复关注该店铺";//前端-用户模块-关注中心-06消息
    public static final String MG013307 = "该商品已被关注";//前端-用户模块-关注中心-07消息
    public static final String MG013308 = "该商品未被关注";//前端-用户模块-关注中心-08消息
    public static final String MG013309 = "该商铺已被关注";//前端-用户模块-关注中心-09消息
    public static final String MG01330a = "该商铺未被关注";//前端-用户模块-关注中心-0a消息
    public static final String MG01330b = "关注失败";
    public static final String MG01330c = "认证失败";
    public static final String MG01330d = "新密码输入不一致";
    public static final String MG01330e = "密码输入错误";
    public static final String MG01330f = "密码设置失败";
    public static final String MG01330g = "银行卡不一致";
    public static final String MG01330h = "没有该银行卡AB:";
    public static final String MG01330i = "手机号已被绑定,请更换手机号";
    public static final String MG01330j = "此卡已经绑定，请重试";
    public static final String MG01330k = "银行卡验证请求返回的json为null";


    //==========================/订单模块===========================


    //==========================订单模块===========================
    //第四位（定义说明）
    public static final String MG012101 = "库存不足，下单失败";
    public static final String MG012102 = "系统繁忙，请重新下单";
    public static final String MG012103 = "系统繁忙，支付失败";
    public static final String MG012104 = "系统繁忙，取消订单失败";
    public static final String MG012105 = "系统繁忙，收货失败";
    public static final String MG012106 = "系统繁忙，退货失败";
    public static final String MG012107 = "系统繁忙，操作失败";
    public static final String MG012108 = "系统繁忙，评价失败";
    public static final String MG012109 = "支付密码错误，请重新输入";
    public static final String MG012110 = "短信验证码错误，请重新输入";
    public static final String MG012111 = "白条额度不足，下单失败";
    public static final String MG012112 = "白条额度不足，支付失败";
    public static final String MG012113 = "系统繁忙，退款失败";
    public static final String MG012114 = "订单号为空";
    public static final String MG012115 = "未查询到该订单";
    public static final String MG012116 = "未查询到该银行卡";
    public static final String MG012117 = "未查询持有该银行卡的用户";
    public static final String MG012118 = "验证码发送失败";
    public static final String MG012119 = "订单状态有误";
    //==========================/订单模块===========================


    //==========================购物车模块===========================
    //第四位（定义说明）
    public static final String MG014101 = "库存不足，加入购物车失败";
    //==========================/购物车模块===========================

    //==========================运费模块===========================
    //第四位（定义说明）
    public static final String MG015101 = "不支持此地区运送";
    //==========================/运费模块===========================

    //==========================/白条模块===========================
    public static final String MG016101 = "不支持继续分期";
    public static final String MG016102 = "此白条记录不属于当前用户";
    public static final String MG016103 = "分期数错误";
    public static final String MG016104 = "类型错误";
    public static final String MG016105 = "可用白条额度不足";
    public static final String MG016106 = "未开通白条";
    public static final String MG016107 = "未找到订单";
    public static final String MG016108 = "提额的白条额度不能低于";
    public static final String MG016109 = "不存在该用户ID：";
    public static final String MG016110 = "该用户信用状态为已禁用";
    public static final String MG016166 = "其它";
    //==========================/白条模块===========================


    //==========================/众筹模块===========================
    public static final String MG017101 = "获取不到登录用户";
    public static final String MG017102 = "项目状态不正确";
    public static final String MG017103 = "获取不到项目id";
    public static final String MG017104 = "项目id错误";
    public static final String MG017105 = "";
    public static final String MG017106 = "";
    public static final String MG017107 = "";
    public static final String MG017108 = "";
    public static final String MG017109 = "：";
    public static final String MG017110 = "";
    public static final String MG017166 = "";

    //==========================/众筹模块===========================

    //=========================管理员后台端========================
    //==========================公共模块===========================
    public static final String MG110101 = "操作成功";//管理员后台端-公共模块-操作成功提示-01消息
    public static final String MG110102 = "操作失败";//管理员后台端-公共模块-操作成功提示-02消息
    //==========================/公共模块===========================

    //==========================商品模块===========================
    public static final String MG021101 = "未配置类目关联的属性、规格或品牌";//管理员后台端-商品模块-商品发布-01消息
    public static final String MG021102 = "请确认是否已开店";//管理员后台端-商品模块-商品发布-01消息
    public static final String MG021103 = "未配置运费模板";//管理员后台端-商品模块-商品发布-01消息

    //==========================/商品模块===========================

    //==========================还款模块============================
    public static final String MG031101 = "还款额度不足";
    //==========================还款模块============================
    //==========================app=================================
    public static final String MG041101 = "未绑定手机";
    public static final String MG041102 = "绑定手机失败";
    public static final String MG041103 = "姓名错误";
    public static final String MG041104 = "证件号错误";
    public static final String MG041105 = "银行卡号错误";
    public static final String MG041106 = "未绑定证件号";
    public static final String MG041107 = "未知校验对象";
    public static final String MG041108 = "该证件号已绑定";

    //==========================app=================================

    //=========================众筹模块=============================
    public static final String MG051101 = "上传文件不存在";
    public static final String MG051102 = "上传文件过大";
    public static final String MG051103 = "文件格式不正确";
    public static final String MG051104 = "上传文件异常";
    public static final String MG051105 = "未知选择类型";
    public static final String MG051106 = "证件要上传";
    public static final String MG051107 = "没传token";

    //=========================众筹模块=============================
    //=========================优惠卷模块===========================
    public static final String MG061101 = "该优惠卷已领取";
    public static final String MG061102 = "该优惠卷已被全部领取";
    //=========================优惠卷模块===========================

    //==========================提示消息Map===========================
    private static final Map<String, String> msgMap = new HashMap<String, String>();

    public static void init() {
        msgMap.put("MG010101", MG010101);
        msgMap.put("MG010102", MG010102);
        msgMap.put("MG110101", MG110101);
        msgMap.put("MG110102", MG110102);
        msgMap.put("MG021101", MG021101);
        msgMap.put("MG021102", MG021102);
        msgMap.put("MG021103", MG021103);
    }
    //==========================/提示消息Map===========================

    public static String getValue(String key) {
        init();
        return (String) msgMap.get(key);
    }
}
